package com.hamster.crmpre.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hamster.crmpre.pojo.Scheme;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

import java.util.Date;

/**
 * @author Tarry
 * @create 2019/12/31 11:24
 */
@Repository
@Mapper
public interface SchemeMapper extends BaseMapper<Scheme> {
    //定时结束 执行方案，修改state = 2      0新建  1已下发   2已完成
    @Update("update scheme_employee set state = 2 where scheme_end_time <= #{date}")
    void updateEndScheme(@Param("date") Date endDate);
}
